import requests


class Login:
    def __init__(self):
        self.url = "http://ihrm-test.itheima.net"

    def login(self, body):
        url = self.url + "/api/sys/login"
        return requests.post(url, json=body)
    def hq_token(self,body):
        resp = self.login(body)
        token = resp.json().get("data")
        return token
    def add_emp(self,body,header):
        url = self.url + "/api/sys/user"
        return requests.post(url,json=body,headers=header)